package com.home.dao;

import java.util.HashMap;
import java.util.Map;

import org.hibernate.Criteria;

import com.home.model.dto.AccountDto;
import com.home.model.dto.AgentDto;
import com.home.model.entity.Account;

public class AccountDao extends GenericDAO<Account>{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	public AccountDao(){
		super(Account.class);
	}
	
	public AccountDto findAccountForLogin(String username, String password) {
		AccountDto acc = null;
		Map<String, Object> parameters = new HashMap<String, Object>();
        parameters.put("username", username);
        parameters.put("password", password);
        Account accEntity = super.findOneResult(Account.FIND_ACCOUNT_LOGIN, parameters);
        if (accEntity != null) {
        	acc = new AccountDto(accEntity);
        }
		return acc;
	}
}
